<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
	function ret(){
		/*
		var js = {
					"user": {
						"email":"teste@email.com.br",
						"name":"Rodrigo Machado",
						"userPassword":"teste"
					}
				}
		*/
		var js = {
		    "order":{
		        "establishment":"1",
		        "quantity":"2",
		        "item":"6",
	        	"user":{
	        		"email":"machado.rodrigom@gmail.com"
	        	}
		     }
		 };

		ajaxRequest('/amigooo/order/create', js);
		//ajaxRequest('/amigooo/mobile/register', js);
	}

	function ajaxRequest(url,content){
		$.ajax({
			url : url,
			type : "POST",
			data : JSON.stringify(content),
			dataType : "json",
			contentType : "application/json; charset=utf-8",
			cache : false,
		}).done(function(data){
			alert("done");
		}).fail(function(data){
			alert("error");
		});
	}
</script>
</head>
<body >
	<input type="button" id="send" onclick="ret()" value="Send"/>

</body>
</html>